<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/commons/taglibs.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
  <title>bvcQrCode列表</title>
</head>
<body>
<table class="table table-striped table-bordered table-hover" id="bvcQrCodeList">
  <thead>
  <tr>
    <td>扫描时间</td>
    <td>用户昵称</td>
    <td>扫描类型</td>
    <td>二维码渠道名称</td>
    <td>二维码类型</td>
    <td>OpenID</td>
    <td>性别</td>
    <td>地区</td>
    <td>操作</td>
  </tr>
  <%--
  <c:forEach items="${resultMap.data}" var="bean">
      <tr id="${bean.scene_id}">
              <td>${bean.sceneStr}</td>
              <td>${bean.createAt}</td>
              <td>${bean.createDate}</td>
              <td>${bean.actionName}</td>
              <td>${bean.sceneName}</td>
              <td>${bean.actionInfo}</td>
              <td>${bean.imageUrl}</td>
              <td>${bean.url}</td>
         <td>
             <a href="${ctx}/bvcQrCode/form?id=${bean.scene_id}">修改</a>
             <a href="${ctx}/bvcQrCode/del?id=${bean.scene_id}">删除</a>
         </td>
     </tr>
  </c:forEach>
  --%>
  </thead>
</table>
<script type="text/javascript" src="${ctx}/static/js/DataTables/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="${ctx}/static/js/DataTables/js/jquery.dataTables_bootstrap.js"></script>
<script type="text/javascript" src="${ctx}/static/js/DataTables/js/dataTables.defaults.js"></script>
<link href="${ctx}/static/js/DataTables/css/dataTables.bootstrap.css" type="text/css" rel="stylesheet" />
<script type="text/javascript">
  var table=null;
  $(function(){
    table=$("#bvcQrCodeList").DataTable({
      "sAjaxSource": "${ctx}/bvcQrCode/${appid}/scanWechatData",
      "aoColumns": [
        {"mData": "scanTime", "sDefaultContent": ""},
        {"mData": "nickName", "sDefaultContent": ""},
        {"mData": "subscribe", "sDefaultContent": ""},
        {"mData": "sceneName", "sDefaultContent": ""},
        {"mData": "qrcodeType", "sDefaultContent": ""},
        {"mData": "openid", "sDefaultContent": ""},
        {"mData": "sex", "sDefaultContent": ""},
        {"mData": "area", "sDefaultContent": ""},
        {"mData": "id",
          "mRender":function(data){
            var opt='<a href="${ctx}/bvcQrCode/form?id='+data+'">修改</a>'
                    +'<a class="btn btn-small" onclick="del(\'' + data + '\')">删除</a>';
            return opt;
          }
        }
      ]
    });
  });
  function del(id){
    layer.confirm('确定删除?', function(){
      $.post("${ctx}/bvcQrCode/del",{id:id},function(d){
        table.page(table.page()).draw(false);
        layer.msg(d.msg);
      },"json");
    });
  }
</script>
</body>
</html>
